"use strict"
/// <reference path="../../index.d.ts" />
const Controller = require("egg").Controller
const { sendStat } = require("../extend/helper")
class ModuleController extends Controller {
	constructor(ctx) {
		super(ctx)
		this.Module = this.app.model.Module
	}
	async list() {
		let data = await this.Module.findAll()
		this.ctx.body = sendStat(this.config.constant.NORMAL, data)
	}
	
	async get(){
		this.ctx.validate({mid:"numstr"},this.ctx.query)
		let data=await this.service.moduleApplicat.getModuleAppById(this.ctx.query.mid)
		this.ctx.body=sendStat(this.config.constant.NORMAL, data)
	}
}

module.exports = ModuleController